#include "result.h"
#include <QFileInfo>
#include <QDebug>
#include <QDateTime>

result::result()
{
    filename = "result.xlsx";
}

result::result(QString filename)
{
    this->filename = filename;
}

void result::Set_filename(QString name)
{
    this->filename = name;
    Open_file();
}
QString result::Get_filename(void)
{
    return filename;
}

int result::Open_file(void)
{
    return 1;

}

int result::Get_line(void)
{
    mutex.lock();
    int res = idle_line;
    idle_line++;
    mutex.unlock();
    QDateTime date = QDateTime::currentDateTime();
    QString date_str = date.toString("yyyy-MM-dd hh:MM:ss");
    Write_result(res,RESULT_TIME_COL,date_str);
    return res;
}

int result::Write_result(int line,int col, QString result)
{
    return 1;
}
